package com.ns.scs.rsr.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ns.scs.rsr.dto.RsrPageDto;
import com.ns.scs.rsr.entry.RsrApplyEntry;
import com.ns.scs.rsr.mapper.RsrApplyEntryMapper;
import com.ns.scs.rsr.vo.RsrInfoVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 参数业务实现
 *
 * @author lw
 * @since 2024/09/23
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class RsrApplyServiceImpl extends ServiceImpl<RsrApplyEntryMapper, RsrApplyEntry> implements IRsrApplyService {

    private final RsrApplyEntryMapper mapper;

    @Override
    public RsrInfoVO getApplyById(Long id) {
        return mapper.getApplyById(id);
    }

    @Override
    public Page<RsrInfoVO> getList(RsrPageDto dto) {
        return mapper.getList(dto, new Page<>(dto.getCurrent(), dto.getSize()));
    }


    @Override
    public List<RsrInfoVO> getApplyByUid(Long uid) {
        return mapper.getApplyByUid(uid);
    }
}
